﻿namespace assignment2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Clock alarmClock = new Clock();
            alarmClock.Tick += () =>
            {
                Console.WriteLine("嘀嗒声...");
            };

            alarmClock.Alarm += (message) =>
            {
                Console.WriteLine(message);
            };

            Console.WriteLine("当前时间: " + DateTime.Now.ToString("HH:mm:ss"));
            Console.WriteLine("设置闹钟时间(默认10秒后)...");
            alarmClock.SetAlarmTime(DateTime.Now.AddSeconds(10));

            alarmClock.Start();
        }
    }
}
